package com.ly.houses.model;

import java.util.HashMap;

public class ResultUtil extends HashMap {
    static final String SUCCESS = "SUCCESS";

    public static Result success(Object object) {
        Result result = new Result();
        result.setCode(Integer.valueOf(0));
        result.setMessage(SUCCESS);
        if (object != null) {
            result.setData(object);
        }

        return result;
    }

    public static Result success() {
        return success((Object) null);
    }

    public static Result error(Integer code, String message) {
        Result result = new Result();
        result.setCode(code);
        result.setMessage(message);
        return result;
    }
}
